﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WebEditBackGround
{
    public partial class Frm_店铺信息管理 : Form
    {
        public Frm_店铺信息管理()
        {
            InitializeComponent();
        }

        WebClient myWebClient = new WebClient();

        SysClass SC = new SysClass();

        DataTable dt_店铺列表 = new DataTable();

        DataTable dt_OneShop_TBGalleryViewLogo = new DataTable();
        DataTable dt_OneShop_TBGalleryViewMain = new DataTable();
        DataTable dt_OneShop_TBGalleryViewFuBig = new DataTable();
        DataTable dt_OneShop_TBGalleryViewFuSmall = new DataTable();


        string cx_NowSelectShopID = "";

        string css_ImgName_Old_主图 = "";
        string css_ImgRemark_Old_主图 = "";

        string css_ImgName_Old_小副图 = "";
        string css_ImgRemark_Old_小副图 = "";

        string css_ImgName_Old_大副图 = "";
        string css_ImgRemark_Old_大副图 = "";

        string css_GalleryMessage_old = "";
        string css_GalleryTheme_Old = "";

        string css_GoodsTypeID_Old_主图 = "";
        string css_GoodsTypeID_Old_小副图 = "";
        string css_GoodsTypeID_Old_大副图 = "";


        private void Frm_店铺信息管理_Load(object sender, EventArgs e)
        {
            try
            {
                SC.FF_DGV_格式设置(DGV_店铺列表,false);
                SC.FF_DGV_格式设置(DGV_主图列表, false);
                SC.FF_DGV_格式设置(DGV_小副图列表, false);
                SC.FF_DGV_格式设置(DGV_大副图列表, false);
                FF_查询所有展厅信息();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        // ⑤查询--所有展厅信息
        // /api/gallery.select.all


        public void FF_查询所有展厅信息()
        {
            try
            {
                string _postUrl = SysClass.cx_url_post + "/api/gallery.select.all";
                string _postData = "";

                string _response_str = "";

                _response_str = SC.FF_PostWebRequest(_postUrl, _postData);
                //MessageBox.Show(_response_str);

                Code.Model.ShopList.Response_店铺列表 _respon_class = JsonConvert.DeserializeObject<Code.Model.ShopList.Response_店铺列表>(_response_str);

                dt_店铺列表 = SC.FF_JsonToDataTable<Code.Model.ShopList.TableModel_店铺列表>(_respon_class.TB_GalleryList);

                //MessageBox.Show(dt_店铺列表.Rows.Count.ToString());

                DGV_店铺列表.DataSource = dt_店铺列表;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void DGV_店铺列表_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (DGV_店铺列表.SelectedRows.Count == 0)
            {
                return;
            }
            else
            {
                cx_NowSelectShopID = DGV_店铺列表.SelectedRows[0].Cells["GalleryNum"].Value.ToString();


                #region 加载店铺信息

                FF_加载一家店铺的信息();


                #endregion

            }
        }

        private void FF_加载一家店铺的信息()
        {
            //string cs_postUrl = SysClass.cx_url_post + "/api/gallery.select.bycode";
            string cs_postUrl = SysClass.cx_url_post + "/api/gallery.select.bycode.v2";

            Code.Model.Shop_one.Request_shop_one _request = new Code.Model.Shop_one.Request_shop_one();
            _request.GalleryNum = cx_NowSelectShopID;

            string cs_in = JsonConvert.SerializeObject(_request);
            string cs_out = SC.FF_PostWebRequest(cs_postUrl, cs_in);

            Code.Model.Shop_one.Response_shop_one _response = JsonConvert.DeserializeObject<Code.Model.Shop_one.Response_shop_one>(cs_out);

            tb_文案标题.Text = _response.GalleryTheme;
            rtb_文案内容.Text = _response.GalleryMessage;

            css_GalleryMessage_old = _response.GalleryMessage;
            css_GalleryTheme_Old = _response.GalleryTheme;

            if (_response.RowNum != 0)// if 01
            {


                //dt_OneShop = SC.FF_JsonToDataTable<Code.Model.Shop_one.TableModel_OneShop>(_response.TBGalleryView);
                //if (_response.TBGalleryViewLogo.Count != 0 && _response.TBGalleryViewLogo != null )

                //-------------------------------------------------------------------------------------------------------------------------
                if (_response.TBGalleryViewLogo != null)
                {
                    dt_OneShop_TBGalleryViewLogo = SC.FF_JsonToDataTable<Code.Model.Shop_one.TableModel_OneShop>(_response.TBGalleryViewLogo);

                    try
                    {
                        string picURL = SysClass.cx_path_imgsave_a + dt_OneShop_TBGalleryViewLogo.Rows[0]["ImgPath"].ToString();
                        //pictureBox旧图标.Image = Image.FromFile(picURL);
                        //pictureBox旧图标.SizeMode = PictureBoxSizeMode.Zoom;

                        //string picURL = SysClass.cx_path_imgsave_a + DGV_小副图列表.SelectedRows[0].Cells["ImgPath"].Value.ToString();
                        //pictureBox主图预览.Image = Image.FromFile(picURL);
                        SC.FF_PictureBox显示URL图片(pictureBox旧图标, picURL);

                    }
                    catch
                    {
                        //MessageBox.Show("Logo可能已经被删除，请重新上传");
                        pictureBox旧图标.Image = null;
                    }

                }
                else
                {
                    pictureBox旧图标.Image = null;
                }

                //-------------------------------------------------------------------------------------------------------------------------
                if (_response.TBGalleryViewMain != null)
                {
                    dt_OneShop_TBGalleryViewMain = SC.FF_JsonToDataTable<Code.Model.Shop_one.TableModel_OneShop>(_response.TBGalleryViewMain);

                    DGV_主图列表.DataSource = dt_OneShop_TBGalleryViewMain;

                    if (DGV_主图列表.Rows.Count != 0)
                    {
                        DGV_主图列表.CurrentCell = DGV_主图列表.Rows[0].Cells[0];
                    }
                    
                }
                else
                {
                    DGV_主图列表.DataSource = null;
                   
                }
                pictureBox主图预览.Image = null;

                //-------------------------------------------------------------------------------------------------------------------------
                if (_response.TBGalleryViewFuBig != null)
                {
                    dt_OneShop_TBGalleryViewFuBig = SC.FF_JsonToDataTable<Code.Model.Shop_one.TableModel_OneShop>(_response.TBGalleryViewFuBig);

                    DGV_大副图列表.DataSource = dt_OneShop_TBGalleryViewFuBig;
                    if (DGV_大副图列表.Rows.Count != 0)
                    {
                        DGV_大副图列表.CurrentCell = DGV_大副图列表.Rows[0].Cells[0];
                    }
                }
                else
                {
                    DGV_大副图列表.DataSource = null;
                   
                }
                pictureBox大副图预览.Image = null;

                //-------------------------------------------------------------------------------------------------------------------------
                if (_response.TBGalleryViewFuSmall != null)
                {
                    dt_OneShop_TBGalleryViewFuSmall = SC.FF_JsonToDataTable<Code.Model.Shop_one.TableModel_OneShop>(_response.TBGalleryViewFuSmall);

                    DGV_小副图列表.DataSource = dt_OneShop_TBGalleryViewFuSmall;
                    if (DGV_小副图列表.Rows.Count != 0)
                    {
                        DGV_小副图列表.CurrentCell = DGV_小副图列表.Rows[0].Cells[0];
                    }
                }
                else
                {
                    DGV_小副图列表.DataSource = null;
                    
                }
                pictureBox小副图预览.Image = null;
            }// end if 01
            else
            {
                //全部子一级 都清空
                DGV_主图列表.DataSource = null;
                DGV_大副图列表.DataSource = null;
                DGV_小副图列表.DataSource = null;
                pictureBox旧图标.Image = null;
                pictureBox主图预览.Image = null;
                pictureBox大副图预览.Image = null;
                pictureBox小副图预览.Image = null;
            }


            //MessageBox.Show("数据加载完成");
        }


        private void DGV_店铺列表_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            //选择Logo
            try
            {

               string cs_fName = "";

                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.RestoreDirectory = true;
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    cs_fName = openFileDialog.FileName;
                    lb_本地Logod的路径.Text = cs_fName;
                    pictureBox新图标.Image = Image.FromFile(cs_fName);
                    pictureBox新图标.SizeMode = PictureBoxSizeMode.Zoom;
                }




                
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            try
            {
                //WebClient myWebClient = new WebClient();

                String uriString = "http://127.0.0.1:5000/api/fileup.image";
                string cs_fName = "";


                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.RestoreDirectory = true;
                if (openFileDialog.ShowDialog() == DialogResult.OK)// if 01
                {
                    cs_fName = openFileDialog.FileName;
                    lb_本地Logod的路径.Text = cs_fName;

                    byte[] responseArray = myWebClient.UploadFile(uriString, "POST", cs_fName);
                    string x2 = System.Text.Encoding.ASCII.GetString(responseArray);
                    MessageBox.Show(x2);
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            //确认上传
            try
            {
                string GalleryNum = DGV_店铺列表.SelectedRows[0].Cells["GalleryNum"].Value.ToString();
                string GalleryName = DGV_店铺列表.SelectedRows[0].Cells["GalleryName"].Value.ToString();
                string ImgType = "1";
                string ImgName = GalleryName + "的Logo";
                string ImgRemark = GalleryName + "的Logo";



                //WebClient myWebClient = new WebClient();
                string uriString = SysClass.cx_url_post + "/api/fileup.image.byshop?GalleryNum=" + GalleryNum + "&ImgRemark=" + ImgRemark + "&ImgType=" + ImgType + "&ImgName=" + ImgName;

                byte[] responseArray = myWebClient.UploadFile(uriString, "POST", lb_本地Logod的路径.Text);

                string cs_return = System.Text.Encoding.ASCII.GetString(responseArray);

                Code.Model.Base.BaseResponse _BassResponse = JsonConvert.DeserializeObject<Code.Model.Base.BaseResponse>(cs_return);
                
                //MessageBox.Show(cs_return);
                //MessageBox.Show(_BassResponse.ReturnValue.ToString());
                if (_BassResponse.ReturnValue == true)
                {
                    //MessageBox.Show(dt_OneShop_TBGalleryViewLogo.Rows[0]["ImgPath"].ToString());
                    FF_加载一家店铺的信息();
                    MessageBox.Show("Logo上传成功！");
                }
                else
                {
                    MessageBox.Show(_BassResponse.ErrorInfo.ErrorMsg);
                }


            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }


        private void DGV_主图列表_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (DGV_主图列表.SelectedRows.Count == 0)
                {
                    css_ImgName_Old_主图 = "";
                    css_ImgRemark_Old_主图 = "";
                    css_GoodsTypeID_Old_主图 = "";


                    rtb_瓷砖_主图.Checked = false;

                    return;
                }

                tb_主图_图片名称.Text = DGV_主图列表.SelectedRows[0].Cells["ImgName"].Value.ToString();
                tb_主图_图片备注.Text = DGV_主图列表.SelectedRows[0].Cells["ImgRemark"].Value.ToString();

                css_ImgName_Old_主图 = tb_主图_图片名称.Text;
                css_ImgRemark_Old_主图 = tb_主图_图片备注.Text;

                css_GoodsTypeID_Old_主图 = DGV_主图列表.SelectedRows[0].Cells["GoodsTypeID"].Value.ToString();




                //if (css_GoodsTypeID_Old_主图 == "1") rtb_瓷砖_主图.Checked = true; else rtb_瓷砖_主图.Checked = false;
                if (css_GoodsTypeID_Old_主图 == "1") rtb_瓷砖_主图.Checked = true; else rtb_瓷砖_主图.Checked = false;
                if (css_GoodsTypeID_Old_主图 == "2") rtb_石材_主图.Checked = true; else rtb_石材_主图.Checked = false;
                if (css_GoodsTypeID_Old_主图 == "3") rtb_西瓦_主图.Checked = true; else rtb_西瓦_主图.Checked = false;
                if (css_GoodsTypeID_Old_主图 == "6") rtb_马桶_主图.Checked = true; else rtb_马桶_主图.Checked = false;
                if (css_GoodsTypeID_Old_主图 == "8") rtb_浴缸_主图.Checked = true; else rtb_浴缸_主图.Checked = false;
                if (css_GoodsTypeID_Old_主图 == "9") rtb_橱柜_主图.Checked = true; else rtb_橱柜_主图.Checked = false;
                if (css_GoodsTypeID_Old_主图 == "11") rtb_马赛克_主图.Checked = true; else rtb_马赛克_主图.Checked = false;
                if (css_GoodsTypeID_Old_主图 == "5") rtb_浴室柜_主图.Checked = true; else rtb_浴室柜_主图.Checked = false;
                if (css_GoodsTypeID_Old_主图 == "7") rtb_淋浴房_主图.Checked = true; else rtb_淋浴房_主图.Checked = false;
                if (css_GoodsTypeID_Old_主图 == "4") rtb_五金水件_主图.Checked = true; else rtb_五金水件_主图.Checked = false;
                if (css_GoodsTypeID_Old_主图 == "10") rtb_其他_主图.Checked = true; else rtb_其他_主图.Checked = false;

                if (css_GoodsTypeID_Old_主图 == "0") rtb_瓷砖_主图.Checked = false;


                try
                {
                    string picURL = SysClass.cx_path_imgsave_a + DGV_主图列表.SelectedRows[0].Cells["ImgPath"].Value.ToString();
                    //pictureBox主图预览.Image = Image.FromFile(picURL);
                    SC.FF_PictureBox显示URL图片(pictureBox主图预览, picURL);
                }
                catch(Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                    pictureBox主图预览.Image = null;
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void DGV_大副图列表_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (DGV_大副图列表.SelectedRows.Count == 0)
                {
                    css_ImgName_Old_大副图 = "";
                    css_ImgRemark_Old_大副图 = "";
                    css_GoodsTypeID_Old_大副图 = "";

                    rtb_瓷砖_大图.Checked = false;

                    return;
                }

                tb_大副图名称.Text = DGV_大副图列表.SelectedRows[0].Cells["ImgName"].Value.ToString();
                tb_大副图备注.Text = DGV_大副图列表.SelectedRows[0].Cells["ImgRemark"].Value.ToString();

                css_ImgName_Old_大副图 = tb_大副图名称.Text;
                css_ImgRemark_Old_大副图 = tb_大副图备注.Text;

                css_GoodsTypeID_Old_大副图 = DGV_大副图列表.SelectedRows[0].Cells["GoodsTypeID"].Value.ToString();


                if (css_GoodsTypeID_Old_大副图 == "1") rtb_瓷砖_大图.Checked = true; else rtb_瓷砖_大图.Checked = false;
                if (css_GoodsTypeID_Old_大副图 == "2") rtb_石材_大图.Checked = true; else rtb_石材_大图.Checked = false;
                if (css_GoodsTypeID_Old_大副图 == "3") rtb_西瓦_大图.Checked = true; else rtb_西瓦_大图.Checked = false;
                if (css_GoodsTypeID_Old_大副图 == "6") rtb_马桶_大图.Checked = true; else rtb_马桶_大图.Checked = false;
                if (css_GoodsTypeID_Old_大副图 == "8") rtb_浴缸_大图.Checked = true; else rtb_浴缸_大图.Checked = false;
                if (css_GoodsTypeID_Old_大副图 == "9") rtb_橱柜_大图.Checked = true; else rtb_橱柜_大图.Checked = false;
                if (css_GoodsTypeID_Old_大副图 == "11") rtb_马赛克_大图.Checked = true; else rtb_马赛克_大图.Checked = false;
                if (css_GoodsTypeID_Old_大副图 == "5") rtb_浴室柜_大图.Checked = true; else rtb_浴室柜_大图.Checked = false;
                if (css_GoodsTypeID_Old_大副图 == "7") rtb_淋浴房_大图.Checked = true; else rtb_淋浴房_大图.Checked = false;
                if (css_GoodsTypeID_Old_大副图 == "4") rtb_五金水件_大图.Checked = true; else rtb_五金水件_大图.Checked = false;
                if (css_GoodsTypeID_Old_大副图 == "10") rtb_其他_大图.Checked = true; else rtb_其他_大图.Checked = false;

                if (css_GoodsTypeID_Old_大副图 == "0") rtb_瓷砖_大图.Checked = false;

                try
                {
                    //pictureBox大副图预览.Image = Image.FromFile(SysClass.cx_path_imgsave_a + DGV_大副图列表.SelectedRows[0].Cells["ImgPath"].Value.ToString());
                    string picURL = SysClass.cx_path_imgsave_a + DGV_大副图列表.SelectedRows[0].Cells["ImgPath"].Value.ToString();
                    //pictureBox主图预览.Image = Image.FromFile(picURL);
                    SC.FF_PictureBox显示URL图片(pictureBox大副图预览, picURL);
                }
                catch
                {
                    pictureBox大副图预览.Image = null;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void DGV_小副图列表_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                try
                {
                    if (DGV_小副图列表.SelectedRows.Count == 0)
                    {
                        css_ImgName_Old_小副图 = "";
                        css_ImgRemark_Old_小副图 = "";
                        css_GoodsTypeID_Old_小副图 = "";

                        rtb_瓷砖_小图.Checked = false;

                        return;
                    }

                    tb_小副图名称.Text = DGV_小副图列表.SelectedRows[0].Cells["ImgName"].Value.ToString();
                    tb_小副图备注.Text = DGV_小副图列表.SelectedRows[0].Cells["ImgRemark"].Value.ToString();

                    css_ImgName_Old_小副图 = tb_小副图名称.Text;
                    css_ImgRemark_Old_小副图 = tb_小副图备注.Text;


                    css_GoodsTypeID_Old_小副图 = DGV_小副图列表.SelectedRows[0].Cells["GoodsTypeID"].Value.ToString();

                    if (css_GoodsTypeID_Old_小副图 == "1") rtb_瓷砖_小图.Checked = true; else rtb_瓷砖_小图.Checked = false;
                    if (css_GoodsTypeID_Old_小副图 == "2") rtb_石材_小图.Checked = true; else rtb_石材_小图.Checked = false;
                    if (css_GoodsTypeID_Old_小副图 == "3") rtb_西瓦_小图.Checked = true; else rtb_西瓦_小图.Checked = false;
                    if (css_GoodsTypeID_Old_小副图 == "6") rtb_马桶_小图.Checked = true; else rtb_马桶_小图.Checked = false;
                    if (css_GoodsTypeID_Old_小副图 == "8") rtb_浴缸_小图.Checked = true; else rtb_浴缸_小图.Checked = false;
                    if (css_GoodsTypeID_Old_小副图 == "9") rtb_橱柜_小图.Checked = true; else rtb_橱柜_小图.Checked = false;
                    if (css_GoodsTypeID_Old_小副图 == "11") rtb_马赛克_小图.Checked = true; else rtb_马赛克_小图.Checked = false;
                    if (css_GoodsTypeID_Old_小副图 == "5") rtb_浴室柜_小图.Checked = true; else rtb_浴室柜_小图.Checked = false;
                    if (css_GoodsTypeID_Old_小副图 == "7") rtb_淋浴房_小图.Checked = true; else rtb_淋浴房_小图.Checked = false;
                    if (css_GoodsTypeID_Old_小副图 == "4") rtb_五金水件_小图.Checked = true; else rtb_五金水件_小图.Checked = false;
                    if (css_GoodsTypeID_Old_小副图 == "10") rtb_其他.Checked = true; else rtb_其他.Checked = false;

                    if (css_GoodsTypeID_Old_小副图 == "0") rtb_其他.Checked = false;

                    try
                    {
                        //pictureBox小副图预览.Image = Image.FromFile(SysClass.cx_path_imgsave_a + DGV_小副图列表.SelectedRows[0].Cells["ImgPath"].Value.ToString());

                        string picURL = SysClass.cx_path_imgsave_a + DGV_小副图列表.SelectedRows[0].Cells["ImgPath"].Value.ToString();
                        //pictureBox主图预览.Image = Image.FromFile(picURL);
                        SC.FF_PictureBox显示URL图片(pictureBox小副图预览, picURL);

                    }
                    catch
                    {
                        pictureBox小副图预览.Image = null;
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }


        private void topbut_选择主图_Click(object sender, EventArgs e)
        {
            try
            {
                string cs_fName = "";

                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.RestoreDirectory = true;
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    cs_fName = openFileDialog.FileName;
                    tb_主图_上传图片路径.Text = cs_fName;
                    pictureBox主图预览.Image = Image.FromFile(cs_fName);
                    //pictureBox新图标.SizeMode = PictureBoxSizeMode.Zoom;

                    tb_主图_图片备注.Text = "";
                    tb_主图_图片名称.Text = "";

                    if (checkBox1.Checked == true)
                    {
                        tb_主图_图片名称.Text = System.IO.Path.GetFileNameWithoutExtension(openFileDialog.FileName);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void topbut_选择大副图_Click(object sender, EventArgs e)
        {
            try
            {
                string cs_fName = "";

                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.RestoreDirectory = true;
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    cs_fName = openFileDialog.FileName;
                    tb_大副图上传路径.Text = cs_fName;
                    pictureBox大副图预览.Image = Image.FromFile(cs_fName);
                    //pictureBox新图标.SizeMode = PictureBoxSizeMode.Zoom;

                    tb_大副图名称.Text = "";
                    tb_大副图备注.Text = "";


                    if (checkBox2.Checked == true)
                    {
                        tb_大副图名称.Text = System.IO.Path.GetFileNameWithoutExtension(openFileDialog.FileName);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void topbut_选择小副图_Click(object sender, EventArgs e)
        {
            try
            {
                string cs_fName = "";

                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.RestoreDirectory = true;
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    cs_fName = openFileDialog.FileName;
                    tb_小副图上传路径.Text = cs_fName;
                    pictureBox小副图预览.Image = Image.FromFile(cs_fName);
                    //pictureBox新图标.SizeMode = PictureBoxSizeMode.Zoom;

                    tb_小副图名称.Text = "";
                    tb_小副图备注.Text = "";


                    if (checkBox3.Checked == true)
                    {
                        tb_小副图名称.Text = System.IO.Path.GetFileNameWithoutExtension(openFileDialog.FileName);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }


        private void topbut_主图上传_Click(object sender, EventArgs e)
        {
            try
            {
                if (MessageBox.Show("您确认要上传一张新的图片吗？", "操作确认", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }

                string GalleryNum = DGV_店铺列表.SelectedRows[0].Cells["GalleryNum"].Value.ToString();
                string GalleryName = DGV_店铺列表.SelectedRows[0].Cells["GalleryName"].Value.ToString();
                string ImgType = "2";
                string ImgName = tb_主图_图片名称.Text;
                string ImgRemark = tb_主图_图片备注.Text;

                Code.Model.Shop_one.Request_编辑展厅图片文字信息 _requset = new Code.Model.Shop_one.Request_编辑展厅图片文字信息();
                //_requset.MainID = cs_MainID;
                //_requset.ImgName = cs_ImgName;
                //_requset.ImgRemark = cs_ImgRemark;
                _requset.ImgName_Old = css_ImgName_Old_主图;
                _requset.ImgRemark_Old = css_ImgRemark_Old_主图;

                _requset.GoodsTypeID = "0";

                _requset.GoodsTypeID_Old = css_GoodsTypeID_Old_主图;

                //if (rtb_瓷砖_主图.Checked == true) _requset.GoodsTypeID = "1";
                if (rtb_瓷砖_主图.Checked == true) _requset.GoodsTypeID = "1";
                if (rtb_石材_主图.Checked == true) _requset.GoodsTypeID = "2";
                if (rtb_西瓦_主图.Checked == true) _requset.GoodsTypeID = "3";
                if (rtb_马桶_主图.Checked == true) _requset.GoodsTypeID = "6";
                if (rtb_浴缸_主图.Checked == true) _requset.GoodsTypeID = "8";
                if (rtb_橱柜_主图.Checked == true) _requset.GoodsTypeID = "9";
                if (rtb_马赛克_主图.Checked == true) _requset.GoodsTypeID = "11";
                if (rtb_浴室柜_主图.Checked == true) _requset.GoodsTypeID = "5";
                if (rtb_淋浴房_主图.Checked == true) _requset.GoodsTypeID = "7";
                if (rtb_五金水件_主图.Checked == true) _requset.GoodsTypeID = "4";
                if (rtb_其他_主图.Checked == true) _requset.GoodsTypeID = "10";



                string uriString = SysClass.cx_url_post + "/api/fileup.image.byshop?GalleryNum=" + GalleryNum + "&ImgRemark=" + ImgRemark + "&ImgType=" + ImgType + "&ImgName=" + ImgName + "&GoodsTypeID=" + _requset.GoodsTypeID;

                byte[] responseArray = myWebClient.UploadFile(uriString, "POST", tb_主图_上传图片路径.Text);

                string cs_return = System.Text.Encoding.ASCII.GetString(responseArray);

                Code.Model.Base.BaseResponse _BassResponse = JsonConvert.DeserializeObject<Code.Model.Base.BaseResponse>(cs_return);

                if (_BassResponse.ReturnValue == true)
                {
                    //MessageBox.Show(dt_OneShop_TBGalleryViewLogo.Rows[0]["ImgPath"].ToString());
                    FF_加载一家店铺的信息();
                    //MessageBox.Show("主图上传成功！");
                }
                else
                {
                    MessageBox.Show(_BassResponse.ErrorInfo.ErrorMsg);
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                MessageBox.Show(ex.ToString());
            }
        }

        private void topbut_大副图上传_Click(object sender, EventArgs e)
        {
            try
            {
                if (MessageBox.Show("您确认要上传一张新的图片吗？", "操作确认", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }

                string GalleryNum = DGV_店铺列表.SelectedRows[0].Cells["GalleryNum"].Value.ToString();
                string GalleryName = DGV_店铺列表.SelectedRows[0].Cells["GalleryName"].Value.ToString();
                string ImgType = "4";
                string ImgName = tb_大副图名称.Text;
                string ImgRemark = tb_大副图备注.Text;


                Code.Model.Shop_one.Request_编辑展厅图片文字信息 _requset = new Code.Model.Shop_one.Request_编辑展厅图片文字信息();
                //_requset.MainID = cs_MainID;
                //_requset.ImgName = cs_ImgName;
                //_requset.ImgRemark = cs_ImgRemark;
                _requset.ImgName_Old = css_ImgName_Old_大副图;
                _requset.ImgRemark_Old = css_ImgRemark_Old_大副图;

                _requset.GoodsTypeID = "0";

                _requset.GoodsTypeID_Old = css_GoodsTypeID_Old_大副图;


                if (rtb_瓷砖_大图.Checked == true) _requset.GoodsTypeID = "1";
                if (rtb_石材_大图.Checked == true) _requset.GoodsTypeID = "2";
                if (rtb_西瓦_大图.Checked == true) _requset.GoodsTypeID = "3";
                if (rtb_马桶_大图.Checked == true) _requset.GoodsTypeID = "6";
                if (rtb_浴缸_大图.Checked == true) _requset.GoodsTypeID = "8";
                if (rtb_橱柜_大图.Checked == true) _requset.GoodsTypeID = "9";
                if (rtb_马赛克_大图.Checked == true) _requset.GoodsTypeID = "11";
                if (rtb_浴室柜_大图.Checked == true) _requset.GoodsTypeID = "5";
                if (rtb_淋浴房_大图.Checked == true) _requset.GoodsTypeID = "7";
                if (rtb_五金水件_大图.Checked == true) _requset.GoodsTypeID = "4";
                if (rtb_其他_大图.Checked == true) _requset.GoodsTypeID = "10";


                string uriString = SysClass.cx_url_post + "/api/fileup.image.byshop?GalleryNum=" + GalleryNum + "&ImgRemark=" + ImgRemark + "&ImgType=" + ImgType + "&ImgName=" + ImgName + "&GoodsTypeID=" + _requset.GoodsTypeID;

                byte[] responseArray = myWebClient.UploadFile(uriString, "POST", tb_大副图上传路径.Text);

                string cs_return = System.Text.Encoding.ASCII.GetString(responseArray);

                Code.Model.Base.BaseResponse _BassResponse = JsonConvert.DeserializeObject<Code.Model.Base.BaseResponse>(cs_return);

                if (_BassResponse.ReturnValue == true)
                {
                    //MessageBox.Show(dt_OneShop_TBGalleryViewLogo.Rows[0]["ImgPath"].ToString());
                    FF_加载一家店铺的信息();
                    //MessageBox.Show("大副图上传成功！");
                }
                else
                {
                    MessageBox.Show(_BassResponse.ErrorInfo.ErrorMsg);
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void topbut_小副图上传_Click(object sender, EventArgs e)
        {
            try
            {
                if (MessageBox.Show("您确认要上传一张新的图片吗？", "操作确认", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }

                string GalleryNum = DGV_店铺列表.SelectedRows[0].Cells["GalleryNum"].Value.ToString();
                string GalleryName = DGV_店铺列表.SelectedRows[0].Cells["GalleryName"].Value.ToString();
                string ImgType = "3";
                string ImgName = tb_小副图名称.Text;
                string ImgRemark = tb_小副图备注.Text;


                Code.Model.Shop_one.Request_编辑展厅图片文字信息 _requset = new Code.Model.Shop_one.Request_编辑展厅图片文字信息();
                //_requset.MainID = cs_MainID;
                //_requset.ImgName = cs_ImgName;
                //_requset.ImgRemark = cs_ImgRemark;
                _requset.ImgName_Old = css_ImgName_Old_小副图;
                _requset.ImgRemark_Old = css_ImgRemark_Old_小副图;

                _requset.GoodsTypeID = "0";

                _requset.GoodsTypeID_Old = css_GoodsTypeID_Old_小副图;

                if (rtb_瓷砖_小图.Checked == true) _requset.GoodsTypeID = "1";
                if (rtb_石材_小图.Checked == true) _requset.GoodsTypeID = "2";
                if (rtb_西瓦_小图.Checked == true) _requset.GoodsTypeID = "3";
                if (rtb_马桶_小图.Checked == true) _requset.GoodsTypeID = "6";
                if (rtb_浴缸_小图.Checked == true) _requset.GoodsTypeID = "8";
                if (rtb_橱柜_小图.Checked == true) _requset.GoodsTypeID = "9";
                if (rtb_马赛克_小图.Checked == true) _requset.GoodsTypeID = "11";
                if (rtb_浴室柜_小图.Checked == true) _requset.GoodsTypeID = "5";
                if (rtb_淋浴房_小图.Checked == true) _requset.GoodsTypeID = "7";
                if (rtb_五金水件_小图.Checked == true) _requset.GoodsTypeID = "4";
                if (rtb_其他.Checked == true) _requset.GoodsTypeID = "10";



                string uriString = SysClass.cx_url_post + "/api/fileup.image.byshop?GalleryNum=" + GalleryNum + "&ImgRemark=" + ImgRemark + "&ImgType=" + ImgType + "&ImgName=" + ImgName + "&GoodsTypeID=" + _requset.GoodsTypeID;

                byte[] responseArray = myWebClient.UploadFile(uriString, "POST", tb_小副图上传路径.Text);

                string cs_return = System.Text.Encoding.ASCII.GetString(responseArray);

                Code.Model.Base.BaseResponse _BassResponse = JsonConvert.DeserializeObject<Code.Model.Base.BaseResponse>(cs_return);

                if (_BassResponse.ReturnValue == true)
                {
                    //MessageBox.Show(dt_OneShop_TBGalleryViewLogo.Rows[0]["ImgPath"].ToString());
                    FF_加载一家店铺的信息();
                    //MessageBox.Show("小副图上传成功！");
                }
                else
                {
                    MessageBox.Show(_BassResponse.ErrorInfo.ErrorMsg);
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }


        private void topbut_主图停用_Click(object sender, EventArgs e)
        {
            try
            {
                // /api/gallery.picture.delete

                if (DGV_主图列表.SelectedRows.Count == 0)
                {
                    MessageBox.Show("没有图片可以停用");
                    return;
                }

                if (MessageBox.Show("您确认要停用选中的图片吗？", "操作确认", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }

                string cs_MainID = DGV_主图列表.SelectedRows[0].Cells["MainID"].Value.ToString();

                string uriString = SysClass.cx_url_post + "/api/gallery.picture.delete";
                Code.Model.Shop_one.Request_删除展厅图片 _requsst = new Code.Model.Shop_one.Request_删除展厅图片();
                _requsst.MainID = cs_MainID;
                string cs_in = JsonConvert.SerializeObject(_requsst);
                string cs_out = SC.FF_PostWebRequest(uriString, cs_in);

                //MessageBox.Show(cs_out);
                Code.Model.Base.BaseResponse _response = JsonConvert.DeserializeObject<Code.Model.Base.BaseResponse>(cs_out);
                if (_response.ReturnValue == true)
                {

                    FF_加载一家店铺的信息();
                    //MessageBox.Show("图片停用成功！");
                }
                else
                {
                    MessageBox.Show(_response.ErrorInfo.ErrorMsg);
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void topbut_大副图停用_Click(object sender, EventArgs e)
        {
            try
            {
                if (DGV_大副图列表.SelectedRows.Count == 0)
                {
                    MessageBox.Show("没有图片可以停用");
                    return;
                }

                if (MessageBox.Show("您确认要停用选中的图片吗？", "操作确认", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }

                string cs_MainID = DGV_大副图列表.SelectedRows[0].Cells["MainID"].Value.ToString();

                string uriString = SysClass.cx_url_post + "/api/gallery.picture.delete";
                Code.Model.Shop_one.Request_删除展厅图片 _requsst = new Code.Model.Shop_one.Request_删除展厅图片();
                _requsst.MainID = cs_MainID;
                string cs_in = JsonConvert.SerializeObject(_requsst);
                string cs_out = SC.FF_PostWebRequest(uriString, cs_in);

                //MessageBox.Show(cs_out);
                Code.Model.Base.BaseResponse _response = JsonConvert.DeserializeObject<Code.Model.Base.BaseResponse>(cs_out);
                if (_response.ReturnValue == true)
                {

                    FF_加载一家店铺的信息();
                    //MessageBox.Show("图片停用成功！");
                }
                else
                {
                    MessageBox.Show(_response.ErrorInfo.ErrorMsg);
                }


            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void topbut_小副图停用_Click(object sender, EventArgs e)
        {
            try
            {
                if (DGV_小副图列表.SelectedRows.Count == 0)
                {
                    MessageBox.Show("没有图片可以停用");
                    return;
                }

                if (MessageBox.Show("您确认要停用选中的图片吗？", "操作确认", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }

                string cs_MainID = DGV_小副图列表.SelectedRows[0].Cells["MainID"].Value.ToString();

                string uriString = SysClass.cx_url_post + "/api/gallery.picture.delete";
                Code.Model.Shop_one.Request_删除展厅图片 _requsst = new Code.Model.Shop_one.Request_删除展厅图片();
                _requsst.MainID = cs_MainID;
                string cs_in = JsonConvert.SerializeObject(_requsst);
                string cs_out = SC.FF_PostWebRequest(uriString, cs_in);

                //MessageBox.Show(cs_out);
                Code.Model.Base.BaseResponse _response = JsonConvert.DeserializeObject<Code.Model.Base.BaseResponse>(cs_out);
                if (_response.ReturnValue == true)
                {

                    FF_加载一家店铺的信息();
                    //MessageBox.Show("图片停用成功！");
                }
                else
                {
                    MessageBox.Show(_response.ErrorInfo.ErrorMsg);
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }


        private void topbut_主图信息编辑_Click(object sender, EventArgs e)
        {
            try
            {
                // /api/gallery.picture.information.edit 展厅图片信息修改

                if (DGV_主图列表.SelectedRows.Count == 0)
                {
                    MessageBox.Show("没有图片可以修改");
                    return;
                }

                if (MessageBox.Show("您确认要修改选中的图片吗的信息吗？", "操作确认", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }

                string cs_MainID = DGV_主图列表.SelectedRows[0].Cells["MainID"].Value.ToString();
                string cs_ImgName = tb_主图_图片名称.Text;
                string cs_ImgRemark = tb_主图_图片备注.Text;

                Code.Model.Shop_one.Request_编辑展厅图片文字信息 _requset = new Code.Model.Shop_one.Request_编辑展厅图片文字信息();
                _requset.MainID = cs_MainID;
                _requset.ImgName = cs_ImgName;
                _requset.ImgRemark = cs_ImgRemark;
                _requset.ImgName_Old = css_ImgName_Old_主图;
                _requset.ImgRemark_Old = css_ImgRemark_Old_主图;

                _requset.GoodsTypeID = "0";

                _requset.GoodsTypeID_Old = css_GoodsTypeID_Old_主图;

                //if (rtb_瓷砖_主图.Checked == true) _requset.GoodsTypeID = "1";
                if (rtb_瓷砖_主图.Checked == true) _requset.GoodsTypeID = "1";
                if (rtb_石材_主图.Checked == true) _requset.GoodsTypeID = "2";
                if (rtb_西瓦_主图.Checked == true) _requset.GoodsTypeID = "3";
                if (rtb_马桶_主图.Checked == true) _requset.GoodsTypeID = "6";
                if (rtb_浴缸_主图.Checked == true) _requset.GoodsTypeID = "8";
                if (rtb_橱柜_主图.Checked == true) _requset.GoodsTypeID = "9";
                if (rtb_马赛克_主图.Checked == true) _requset.GoodsTypeID = "11";
                if (rtb_浴室柜_主图.Checked == true) _requset.GoodsTypeID = "5";
                if (rtb_淋浴房_主图.Checked == true) _requset.GoodsTypeID = "7";
                if (rtb_五金水件_主图.Checked == true) _requset.GoodsTypeID = "4";
                if (rtb_其他_主图.Checked == true) _requset.GoodsTypeID = "10";



                string cs_in = JsonConvert.SerializeObject(_requset);
                //string cs_out = SC.FF_PostWebRequest(SysClass.cx_url_post + "/api/gallery.picture.information.edit", cs_in);
                string cs_out = SC.FF_PostWebRequest(SysClass.cx_url_post + "/api/gallery.picture.information.edit.v2", cs_in);
                Code.Model.Base.BaseResponse _response = JsonConvert.DeserializeObject<Code.Model.Base.BaseResponse>(cs_out);
                if (_response.ReturnValue == true)
                {

                    FF_加载一家店铺的信息();
                    //MessageBox.Show("图片文字数据修改成功！");
                }
                else
                {
                    MessageBox.Show(_response.ErrorInfo.ErrorMsg);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void topbut_大副图信息编辑_Click(object sender, EventArgs e)
        {
            try
            {
                if (DGV_大副图列表.SelectedRows.Count == 0)
                {
                    MessageBox.Show("没有图片可以修改");
                    return;
                }

                if (MessageBox.Show("您确认要修改选中的图片吗的信息吗？", "操作确认", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }

                string cs_MainID = DGV_大副图列表.SelectedRows[0].Cells["MainID"].Value.ToString();
                string cs_ImgName = tb_大副图名称.Text;
                string cs_ImgRemark = tb_大副图备注.Text;

                Code.Model.Shop_one.Request_编辑展厅图片文字信息 _requset = new Code.Model.Shop_one.Request_编辑展厅图片文字信息();
                _requset.MainID = cs_MainID;
                _requset.ImgName = cs_ImgName;
                _requset.ImgRemark = cs_ImgRemark;
                _requset.ImgName_Old = css_ImgName_Old_大副图;
                _requset.ImgRemark_Old = css_ImgRemark_Old_大副图;

                _requset.GoodsTypeID = "0";

                _requset.GoodsTypeID_Old = css_GoodsTypeID_Old_大副图;


                if (rtb_瓷砖_大图.Checked == true) _requset.GoodsTypeID = "1";
                if (rtb_石材_大图.Checked == true) _requset.GoodsTypeID = "2";
                if (rtb_西瓦_大图.Checked == true) _requset.GoodsTypeID = "3";
                if (rtb_马桶_大图.Checked == true) _requset.GoodsTypeID = "6";
                if (rtb_浴缸_大图.Checked == true) _requset.GoodsTypeID = "8";
                if (rtb_橱柜_大图.Checked == true) _requset.GoodsTypeID = "9";
                if (rtb_马赛克_大图.Checked == true) _requset.GoodsTypeID = "11";
                if (rtb_浴室柜_大图.Checked == true) _requset.GoodsTypeID = "5";
                if (rtb_淋浴房_大图.Checked == true) _requset.GoodsTypeID = "7";
                if (rtb_五金水件_大图.Checked == true) _requset.GoodsTypeID = "4";
                if (rtb_其他_大图.Checked == true) _requset.GoodsTypeID = "10";




                string cs_in = JsonConvert.SerializeObject(_requset);
                //string cs_out = SC.FF_PostWebRequest(SysClass.cx_url_post + "/api/gallery.picture.information.edit", cs_in);
                string cs_out = SC.FF_PostWebRequest(SysClass.cx_url_post + "/api/gallery.picture.information.edit.v2", cs_in);
                Code.Model.Base.BaseResponse _response = JsonConvert.DeserializeObject<Code.Model.Base.BaseResponse>(cs_out);
                if (_response.ReturnValue == true)
                {

                    FF_加载一家店铺的信息();
                    //MessageBox.Show("图片文字数据修改成功！");
                }
                else
                {
                    MessageBox.Show(_response.ErrorInfo.ErrorMsg);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void topbut_小副图信息编辑_Click(object sender, EventArgs e)
        {
            try
            {

                if (DGV_小副图列表.SelectedRows.Count == 0)
                {
                    MessageBox.Show("没有图片可以修改");
                    return;
                }

                if (MessageBox.Show("您确认要修改选中的图片吗的信息吗？", "操作确认", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }

                string cs_MainID = DGV_小副图列表.SelectedRows[0].Cells["MainID"].Value.ToString();
                string cs_ImgName = tb_小副图名称.Text;
                string cs_ImgRemark = tb_小副图备注.Text;

                Code.Model.Shop_one.Request_编辑展厅图片文字信息 _requset = new Code.Model.Shop_one.Request_编辑展厅图片文字信息();
                _requset.MainID = cs_MainID;
                _requset.ImgName = cs_ImgName;
                _requset.ImgRemark = cs_ImgRemark;
                _requset.ImgName_Old = css_ImgName_Old_小副图;
                _requset.ImgRemark_Old = css_ImgRemark_Old_小副图;

                _requset.GoodsTypeID = "0";

                _requset.GoodsTypeID_Old = css_GoodsTypeID_Old_小副图;

                if (rtb_瓷砖_小图.Checked == true) _requset.GoodsTypeID = "1";
                if (rtb_石材_小图.Checked == true) _requset.GoodsTypeID = "2";
                if (rtb_西瓦_小图.Checked == true) _requset.GoodsTypeID = "3";
                if (rtb_马桶_小图.Checked == true) _requset.GoodsTypeID = "6";
                if (rtb_浴缸_小图.Checked == true) _requset.GoodsTypeID = "8";
                if (rtb_橱柜_小图.Checked == true) _requset.GoodsTypeID = "9";
                if (rtb_马赛克_小图.Checked == true) _requset.GoodsTypeID = "11";
                if (rtb_浴室柜_小图.Checked == true) _requset.GoodsTypeID = "5";
                if (rtb_淋浴房_小图.Checked == true) _requset.GoodsTypeID = "7";
                if (rtb_五金水件_小图.Checked == true) _requset.GoodsTypeID = "4";
                if (rtb_其他.Checked == true) _requset.GoodsTypeID = "10";


                string cs_in = JsonConvert.SerializeObject(_requset);
                //string cs_out = SC.FF_PostWebRequest(SysClass.cx_url_post + "/api/gallery.picture.information.edit", cs_in);
                string cs_out = SC.FF_PostWebRequest(SysClass.cx_url_post + "/api/gallery.picture.information.edit.v2", cs_in);
                Code.Model.Base.BaseResponse _response = JsonConvert.DeserializeObject<Code.Model.Base.BaseResponse>(cs_out);
                if (_response.ReturnValue == true)
                {

                    FF_加载一家店铺的信息();
                    //MessageBox.Show("图片文字数据修改成功！");
                }
                else
                {
                    MessageBox.Show(_response.ErrorInfo.ErrorMsg);
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void but_保存文案修改_Click(object sender, EventArgs e)
        {
            try
            {
                // /api/gallery.infor.edit

                if (MessageBox.Show("您确认要修改文案信息吗？", "操作确认", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }

                string cs_GalleryNum = DGV_店铺列表.SelectedRows[0].Cells["GalleryNum"].Value.ToString();

                Code.Model.Shop_one.Request_编辑展厅文案信息 _requset = new Code.Model.Shop_one.Request_编辑展厅文案信息();
                _requset.GalleryNum = cs_GalleryNum;
                _requset.GalleryTheme = tb_文案标题.Text;
                _requset.GalleryMessage = rtb_文案内容.Text;
                _requset.GalleryTheme_Old = css_GalleryTheme_Old;
                _requset.GalleryMessage_Old = css_GalleryMessage_old;

                string cs_in = JsonConvert.SerializeObject(_requset);
                string cs_out = SC.FF_PostWebRequest(SysClass.cx_url_post + "/api/gallery.infor.edit", cs_in);

                Code.Model.Base.BaseResponse _response = JsonConvert.DeserializeObject<Code.Model.Base.BaseResponse>(cs_out);
                if (_response.ReturnValue == true)
                {

                    FF_加载一家店铺的信息();
                    //MessageBox.Show("保存文案修改成功！");
                }
                else
                {
                    MessageBox.Show(_response.ErrorInfo.ErrorMsg);
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }



    }
}
